#!/usr/bin/env python
# -*- coding: utf-8 -*-
# author:Charles.chen
# createDate:2017/9/5
# Title:
# Tip:
from flask import render_template, redirect, request, url_for, flash, session
from app.internet import internetService
from app.system import systemService
from app.toolkit import commonUtil
from app.internet import internetService
from . import weichenBp, weichenService
import json

# 获取微尘列表
@weichenBp.route("/dustTable", methods=['POST'])
def getDustTable():
    response = weichenService.getDustTableByZigBee()
    return json.dumps(response)
    pass

# 关联微尘处理器 单个或者多个
@weichenBp.route("/dustConnect", methods=['POST'])
def connectDust():
    post_data = json.loads(request.data)
    res = weichenService.addDustMulti(post_data)
    return commonUtil.buildSucc(res)

if __name__ == '__main__':
    pass